package org.hit.burkun.umls.relation.merge;

import java.util.Collection;
import java.util.HashMap;
import java.util.LinkedList;

import org.hit.burkun.entities.Entity;
import org.hit.burkun.umls.relation.UniformRelation;

public class GoGeneMerge {
	public static void main(String[] args) {
		HashMap<String, LinkedList<GeneMergeObject>> res = mergeGo2GoAll();
		Collection<String[]> data = StaticMethods
				.formatToEntity2GeneDbRelWithoutPrimaryId(res,
						Entity.TYPE.GENE_ONTOLOGY);
		StaticMethods.dumpRelationsWithoutPrimaryId(data, "merge_birelation");
	}

	private static HashMap<String, LinkedList<GeneMergeObject>> mergeGo2GoAll() {
		HashMap<String, LinkedList<GeneMergeObject>> oldRes1 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_EXP);
		HashMap<String, LinkedList<GeneMergeObject>> oldRes4 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_IDA);
		HashMap<String, LinkedList<GeneMergeObject>> oldRes10 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_IPI);
		HashMap<String, LinkedList<GeneMergeObject>> oldRes9 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_IMP);
		HashMap<String, LinkedList<GeneMergeObject>> oldRes7 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_IGI);
		HashMap<String, LinkedList<GeneMergeObject>> oldRes6 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_IEP);
		
		HashMap<String, LinkedList<GeneMergeObject>> oldRes3 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_IC);
		HashMap<String, LinkedList<GeneMergeObject>> oldRes13 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_ND);
		
		
		HashMap<String, LinkedList<GeneMergeObject>> oldRes2 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_IBA);
		HashMap<String, LinkedList<GeneMergeObject>> oldRes5 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_IEA);
		HashMap<String, LinkedList<GeneMergeObject>> oldRes8 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_IKR);
		HashMap<String, LinkedList<GeneMergeObject>> oldRes11 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_ISS);
		
		
		HashMap<String, LinkedList<GeneMergeObject>> oldRes12 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_NAS);
		HashMap<String, LinkedList<GeneMergeObject>> oldRes14 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_TAS);

		
		HashMap<String, LinkedList<GeneMergeObject>> oldRes15 = StaticMethods
				.getEntity2Entity(UniformRelation.TYPE.GO_ANNOTATION_GENE_IRD);
		
		oldRes2 = StaticMethods.merge(oldRes1, oldRes2);
		oldRes2 = StaticMethods.merge(oldRes3, oldRes2);
		oldRes2 = StaticMethods.merge(oldRes4, oldRes2);
		oldRes2 = StaticMethods.merge(oldRes5, oldRes2);
		oldRes2 = StaticMethods.merge(oldRes6, oldRes2);
		oldRes2 = StaticMethods.merge(oldRes7, oldRes2);
		oldRes2 = StaticMethods.merge(oldRes8, oldRes2);
		oldRes2 = StaticMethods.merge(oldRes9, oldRes2);
		oldRes2 = StaticMethods.merge(oldRes10, oldRes2);
		oldRes2 = StaticMethods.merge(oldRes11, oldRes2);
		oldRes2 = StaticMethods.merge(oldRes12, oldRes2);
		oldRes2 = StaticMethods.merge(oldRes13, oldRes2);
		oldRes2 = StaticMethods.merge(oldRes14, oldRes2);
		oldRes2 = StaticMethods.merge(oldRes15, oldRes2);

		return oldRes2;
	}
}
